home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 260_01 / sz.1 < prev    next >
Text File  |  1988-02-23  |  11KB  |  406 lines

  1. '\" Revision Level 
  2. '\" Last Delta     01-15-87
  3. .TH SZ 1 OMEN
  4. .SH NAME
  5. sz \- XMODEM, YMODEM, ZMODEM Batch file Send
  6. .SH SYNOPSIS
  7. sz
  8. .RB [\- +1abdefkLlNnopqTtuvy ]
  9. .I file ...
  10. .br
  11. sz -X
  12. .RB [\- 1kqtuv ]
  13. .I file
  14. .br
  15. sz
  16. .RB [\- 1oqtv ]
  17. .B "-c COMMAND"
  18. .br
  19. sz
  20. .RB [\- 1oqtv ]
  21. .B "-i COMMAND"
  22. .SH DESCRIPTION
  23. .B Sz
  24. uses the ZMODEM, YMODEM or XMODEM error correcting protocol to send
  25. one or more files over a serial port to a variety of programs running under
  26. PC-DOS, CP/M, Unix, VMS, and other operating systems.
  27.  
  28.  
  29. The first form of
  30. .B sz
  31. sends one or more files with ZMODEM or YMODEM batch protocol.
  32. Normally, only the file name part of the pathname is transmitted.
  33. On
  34. .SM Unix
  35. systems, additional information about the file is transmitted.
  36. If the receiving program uses this information,
  37. the transmitted file length controls the exact number of bytes written to
  38. the output dataset,
  39. and the modify time and file mode
  40. are set accordingly.
  41.  
  42. Output from another program may be piped to
  43. .B sz
  44. for transmission by specifying the
  45. .B -1
  46. option and denoting standard input by "-":
  47. .ce
  48. ps -ef | sz -
  49. The program output is transmitted with the filename sPID.sz
  50. where PID is the process ID of the
  51. .B sz
  52. program.
  53. If the environment variable
  54. .B ONAME
  55. is set, that is used instead.
  56. In this case, the Unix command:
  57. .ce
  58. ONAME=con ps -ef|sz -ay -
  59. will send a "file" to the PC-DOS console display.
  60. The
  61. .B -y
  62. option instructs the receiver to open the file for writing unconditionally.
  63. The
  64. .B -a
  65. option
  66. causes the receiver to convert Unix newlines to PC-DOS carriage returns
  67. and linefeeds.
  68.  
  69. Unix
  70. .B sz
  71. supports
  72. .B YMODEM-g
  73. with "cbreak" tty mode, XON/XOFF flow control,
  74. and the interrupt character set to CAN.
  75. .B YMODEM-g
  76. (Professional-YAM
  77. .B g
  78. option)
  79. increases throughput over error free channels
  80. (direct connection, X.PC, etc.)
  81. by not acknowledging each transmitted sector.
  82.  
  83.  
  84. The second form of
  85. .B sz
  86. uses the
  87. .B -X
  88. flag to send a single
  89. .I file
  90. with
  91. .B XMODEM
  92. or
  93. .B XMODEM-1k
  94. protocol.
  95. The user must supply the file name to both sending and receiving programs.
  96.  
  97. Iff
  98. .B sz
  99. is invoked with $SHELL set and iff that variable contains the
  100. string
  101. .I "rsh"
  102. or
  103. .I "rksh"
  104. (restricted shell), sz operates in restricted mode.
  105. Restricted mode restricts pathnames to the current directory and
  106. PUBDIR (usually /usr/spool/uucppublic) and/or subdirectories
  107. thereof.
  108.  
  109.  
  110. The third form sends a single COMMAND to the receiver for execution.
  111. .B Sz
  112. exits with the COMMAND return value.
  113. If COMMAND includes spaces or characters special to the shell,
  114. it must be quoted.
  115.  
  116.  
  117. The fourth form sends a single COMMAND to the receiver for execution.
  118. .B Sz
  119. exits as soon as the receiver has correctly received the command,
  120. before it is executed.
  121.  
  122.  
  123. If sz is invoked with stdout and stderr to different datasets,
  124. Verbose is set to 2, causing frame by frame progress reports
  125. to stderr.
  126. This may be disabled with the
  127. .B q
  128. option.
  129. .PP
  130. The meanings of the available options are:
  131. .PP
  132. .PD 0
  133. .TP
  134. .B +
  135. Instruct the receiver to append transmitted data to an existing file
  136. (ZMODEM only).
  137. .TP
  138. .B 1
  139. Use file descriptor 1 for ioctls and reads (Unix only).
  140. By default, file descriptor 0 is used.
  141. This option allows
  142. .B sz
  143. to be used with the
  144. .I cu
  145. ~$
  146. command.
  147. If the calling program has spawned a separate process to
  148. read characters from the modem,
  149. that process 
  150. must be disabled for
  151. .I rz
  152. to operate properly.
  153. .TP
  154. .B a
  155. Convert NL characters in the transmitted file to CR/LF.
  156. This is done by the sender for XMODEM and YMODEM, by the receiver
  157. for ZMODEM.
  158. .TP
  159. .B b
  160. (ZMODEM) Binary override: transfer file without any translation.
  161. .TP
  162. .B "c COMMAND"
  163. Send COMMAND to the receiver for execution, return with COMMAND\'s exit status.
  164. .TP
  165. .B d
  166. Change all instances of "." to "/" in the transmitted pathname.
  167. Thus, C.omenB0000 (which is unacceptable to MSDOS or CP/M)
  168. is transmitted as C/omenB0000.
  169. If the resultant filename has more than 8 characters in the stem,
  170. a "." is inserted to allow a total of eleven.
  171. .TP
  172. .B E
  173. Escape only Ctrl-X control characters;
  174. normally XON, XOFF, CR-@-CR, and Ctrl-X are escaped.
  175. .TP
  176. .B e
  177. Escape all control characters;
  178. normally XON, XOFF, CR-@-CR, and Ctrl-X are escaped.
  179. .TP
  180. .B f
  181. Send Full pathname.
  182. Normally directory prefixes are stripped from the transmitted
  183. filename.
  184. .TP
  185. .B "i COMMAND"
  186. Send COMMAND to the receiver for execution, return Immediately
  187. upon the receiving program's successful recption of the command.
  188. .TP
  189. .B k
  190. (XMODEM/YMODEM) Send files using 1024 byte blocks
  191. rather than the default 128 byte blocks.
  192. 1024 byte packets speed file transfers at high bit rates.
  193. (ZMODEM streams the data for the best possible throughput.)
  194. .TP
  195. .B "L N"
  196. Use ZMODEM sub-packets of length N.
  197. A larger N (32 <= N <= 1024) gives slightly higher throughput,
  198. a smaller N speeds error recovery.
  199. The default is 128 below 300 baud, 256 above 300 baud, or 1024 above 2400 baud.
  200. .TP
  201. .B "l N"
  202. Wait for the receiver to acknowledge correct data every
  203. .B N
  204. (32 <= N <= 1024)
  205. characters.
  206. This may be used to avoid network overrun when XOFF flow control is lacking.
  207. .TP
  208. .B n
  209. (ZMODEM) Send each file if
  210. destination file does not exist.
  211. Overwrite destination file if
  212. source file is newer or longer than the destination file.
  213. .TP
  214. .B N
  215. (ZMODEM) Send each file if
  216. destination file does not exist.
  217. Overwrite destination file if
  218. source file has different length or date.
  219. .TP
  220. .B o
  221. (ZMODEM) Disable automatic selection of 32 bit CRC.
  222. .TP
  223. .B p
  224. (ZMODEM) Protect existing destination files by skipping transfer if the
  225. destination file exists.
  226. .TP
  227. .B q
  228. Quiet suppresses verbosity.
  229. .TP
  230. .B r
  231. Resume interrupted file transfer.
  232. If the source file is longer than the destination file,
  233. the transfer commences at the offset in the source file that equals
  234. the length of the destination file.
  235. .TP
  236. .B "t tim"
  237. Change timeout to
  238. .I tim
  239. tenths of seconds.
  240. .TP
  241. .B u
  242. Unlink the file after successful transmission.
  243. .TP
  244. .B v
  245. Verbose
  246. causes a list of file
  247. names to be appended to
  248. /tmp/szlog .
  249. More v's generate more output.
  250. .TP
  251. .B X
  252. Send a single file with
  253. .B XMODEM
  254. or
  255. .B XMODEM-1k
  256. protocol.
  257. .TP
  258. .B y
  259. Instruct a ZMODEM receiving program to overwrite any existing file
  260. with the same name.
  261. .PD
  262. .SH EXAMPLES
  263. .ne 7
  264. .B "ZMODEM File Transfer"
  265. .br
  266. .B "$ sz -a *.c"
  267. .br
  268. This single command transfers all .c files in the current Unix directory
  269. with conversion
  270. .RB ( -a )
  271. to end of line conventions appropriate to the receiving environment.
  272. With ZMODEM AutoDownload enabled, Professional-YAM automatically recieves
  273. the files after performing a security challenge.
  274.  
  275. .B "ZMODEM Command Download"
  276. .br
  277.  cpszall:all
  278.     sz -c "c:;cd /yam/dist"
  279.     sz -ya $(YD)/*.me
  280.     sz -yqb y*.exe
  281.     sz -c "cd /yam"
  282.     sz -i "!insms"
  283. .br
  284. This Makefile fragment uses
  285. .B sz
  286. to issue commands to Professional-YAM to change current disk and directory.
  287. Next,
  288. .B sz
  289. transfers the
  290. .I .me
  291. files from the $YD directory, commanding the receiver to overwrite the old files
  292. and to convert from Unix end of line conventions to PC-DOS conventions.
  293. The third line transfers some
  294. .I .exe
  295. files.
  296. The fourth and fifth lines command Pro-YAM to
  297. change directory and execute a PC-DOS batch file
  298. .I insms .
  299. Since the batch file takes considerable time, the
  300. .B "-i"
  301. form is used to allow
  302. .B sz
  303. to exit immediately.
  304.  
  305. .B "XMODEM File Transfer"
  306. .br
  307. $
  308. .B "sz -Xa foo.c"
  309. .br
  310. .B "ESC"
  311. .br
  312. .B "rx foo.c"
  313. .br
  314. The above three commands transfer a single file
  315. from Unix to a PC and Crosstalk XVI 3.6,
  316. translating Unix newlines to DOS CR/LF.
  317.  
  318. .SH SEE ALSO
  319. rz(omen),
  320. ZMODEM.DOC,
  321. YMODEM.DOC,
  322. Professional-YAM manual,
  323. IMP(CP/M),
  324. cu(1),
  325. sq(omen),
  326. todos(omen),
  327. tocpm(omen),
  328. tomac(omen),
  329. yam(omen)
  330.  
  331. Compile time options required for various operating systems are described in
  332. the source file.
  333. .SH "VMS VERSION"
  334. The VMS version does not transmit the file date.
  335. The VMS version calculates the file length by reading the file
  336. and counting the bytes.
  337.  
  338. The VMS version does not support YMODEM-g or ZMODEM.
  339.  
  340. When VMS is l